7-4 Days alive and free of hospital by day 28

This outcome was defined as the number of days alive and free of hospital from randomisation to 28 days, calculated as 28 minus the number of days spent in hospital. All patients dying within 28 days will be assigned zero free days.

Authors
Affiliations

James Totterdell

University of Sydney

Rob Mahar

University of Melbourne

Published

July 26, 2023

Load packages
library(ASCOTr)
library(tidyverse)
library(lubridate)
library(kableExtra)
library(patchwork)
library(cmdstanr)
library(posterior)
library(bayesplot)
library(ggdist)
library(lme4)
library(broom)
library(broom.mixed)
library(bayestestR)

theme_set(theme_classic(base_size = 10, base_family = "Palatino") +
  theme(panel.grid = element_blank(),
        strip.background = element_blank()))

bayesplot_theme_set(theme_set(theme_classic(base_size = 10, base_family = "Palatino") +
  theme(panel.grid = element_blank(),
        strip.background = element_blank())))

color_scheme_set("red")
options(digits = 4)
Prepare datasets
all_data <- readRDS(file.path(ASCOT_DATA, "all_data.rds")) |>
  mutate(
    out_dafh2 = if_else(D28_death == 0 & is.na(out_dafh), 28 - DD_total_days, out_dafh)
  )

# FAS-ITT
fas_itt_dat <- ASCOTr:::make_fas_itt_set(all_data)
fas_itt_nona_dat <- fas_itt_dat |>
  filter(!is.na(out_dafh))

# ACS-ITT
acs_itt_dat <- ASCOTr:::make_acs_itt_set(all_data)
acs_itt_nona_dat <- acs_itt_dat |>
  filter(!is.na(out_dafh))

# AVS-ITT
avs_itt_dat <- ASCOTr:::make_avs_itt_set(all_data)
avs_itt_nona_dat <- avs_itt_dat |>
  filter(!is.na(out_dafh))
Load models
ordmod0 <- compile_cmdstanr_mod(
  file.path("ordinal", "logistic_cumulative"), dir = "stan")
ordmod <- compile_cmdstanr_mod(
  file.path("ordinal", "logistic_cumulative_epoch_site"), dir = "stan")
ordmod_site <- compile_cmdstanr_mod(
  file.path("ordinal", "logistic_cumulative_site"), dir = "stan")
logistic <- compile_cmdstanr_mod(
  file.path("binary", "logistic_site_epoch"), dir = "stan")
Functions
make_summary_table_anticoagulation <- function(dat, format = "html") {
  tdat <- dat %>%
  group_by(CAssignment = factor(CAssignment, 
                                levels = c("C0", "C1", "C2", "C3", "C4"),
                                labels = intervention_labels2()$CAssignment)) %>%
  summarise(
    Patients = n(),
    Known = sum(!is.na(out_dafh)),
    Deaths = sprintf(
      "%i (%.0f%%)", sum(D28_death, na.rm = TRUE), 100 * mean(D28_death, na.rm = TRUE)),
    `DAFH, Median (Q1, Q3)` = sprintf(
      "%.0f (%.0f, %.0f)", 
      median(out_dafh, na.rm = T), 
      quantile(out_dafh, 0.25, na.rm = TRUE), 
      quantile(out_dafh, 0.75, na.rm = TRUE))
  ) %>%
  bind_rows(
    dat %>%
  group_by(CAssignment = "Overall") %>%
  summarise(
    Patients = n(),
    Known = sum(!is.na(out_dafh)),
    Deaths = sprintf(
      "%i (%.0f%%)", sum(D28_death, na.rm = TRUE), 100 * mean(D28_death, na.rm = TRUE)),
    `DAFH, Median (Q1, Q3)` = sprintf(
      "%.0f (%.0f, %.0f)", 
      median(out_dafh, na.rm = T), 
      quantile(out_dafh, 0.25, na.rm = TRUE), 
      quantile(out_dafh, 0.75, na.rm = TRUE))
  )
  ) %>%
  rename(`Anticoagulation\nintervention` = CAssignment)
  kable(
    tdat,
    format = format,
    align = "lrrrr",
    booktabs = TRUE,
    linesep = ""
  ) %>%
    kable_styling(
      font_size = 9,
      latex_options = "HOLD_position"
    ) %>%
    row_spec(nrow(tdat), bold = T)
}

make_summary_table_antiviral <- function(dat, format = "html") {
  tdat <- dat %>%
  group_by(AAssignment = factor(AAssignment, 
                                levels = c("A0", "A1", "A2"),
                                labels = intervention_labels2()$AAssignment)) %>%
  summarise(
    Patients = n(),
    Known = sum(!is.na(out_dafh)),
    Deaths = sprintf(
      "%i (%.0f%%)", sum(D28_death, na.rm = TRUE), 100 * mean(D28_death, na.rm = TRUE)),
    `DAFH, Median (Q1, Q3)` = sprintf(
      "%.0f (%.0f, %.0f)", 
      median(out_dafh, na.rm = T), 
      quantile(out_dafh, 0.25, na.rm = TRUE), 
      quantile(out_dafh, 0.75, na.rm = TRUE))
  ) %>%
  bind_rows(
    dat %>%
  group_by(AAssignment = "Overall") %>%
  summarise(
    Patients = n(),
    Known = sum(!is.na(out_dafh)),
    Deaths = sprintf(
      "%i (%.0f%%)", sum(D28_death, na.rm = TRUE), 100 * mean(D28_death, na.rm = TRUE)),
    `DAFH, Median (Q1, Q3)` = sprintf(
      "%.0f (%.0f, %.0f)", 
      median(out_dafh, na.rm = T), 
      quantile(out_dafh, 0.25, na.rm = TRUE), 
      quantile(out_dafh, 0.75, na.rm = TRUE))
  )
  ) %>%
  rename(`Antiviral\nintervention` = AAssignment)
  kable(
    tdat,
    format = format,
    align = "lrrrr",
    booktabs = TRUE,
    linesep = ""
  ) %>%
    kable_styling(
      font_size = 9,
      latex_options = "HOLD_position"
    ) %>%
    row_spec(nrow(tdat), bold = T)
}

Outcome Derivation

The outcome is calculated for a patient as:

  • missing, if day 28 mortality is unknown (D28_PatientStatus) or if the patient was known to have been alive at day 28 but number of days in hospital (D28_OutcomeTotalDaysHospitalised) is unknown
  • 0 if they died by day 28 (D28_PatientStatus)
  • 28 - min(28, D28_OutcomeTotalDaysHospitalised) otherwise

As a cross check, Figure 1 plots the number of days hospitalised (as reported in D28_OutcomeTotalDaysHospitalised) against the day of discharge from the index admission.

There are some participants who were known to be alive at day 28, but had unknown total number of days hospitalised. We may choose to assume that these patients were not re-admitted, and so their total number of days free of hospital is imputed as 28 - DD_total_days, that is, 28 minus the number of days spent in hospital during their index admission.

Compare D28_OutcomeTotalDaysHospitalised to days hospitalised per dischage date.
pdat <- fas_itt_dat %>%
  filter(D28_death != 1) %>%
  dplyr::count(D28_day = pmin(28, D28_OutcomeTotalDaysHospitalised), DIS_day = pmin(28, DIS_day))
ggplot(pdat, aes(D28_day, DIS_day)) +
  geom_point(aes(size = n), shape = 21) +
  geom_abline() +
  scale_x_continuous("Number of days hospitalised (D28_OutcomeTotalDaysHospitalised)",
                     breaks = seq(0, 30, 2)) +
  scale_y_continuous("Day of discharge from index admission",
                     breaks = seq(0, 30, 2)) +
  labs(size = "Count")

Figure 1: Number of days hospitalised against day of discharge from index admission.

Descriptive

The overall distribution of days alive and free of hospital (DAFH) are reported in Figure 2 for all participants in the AVS-ITT set.

Overall distribution of DAFH
pdat <- fas_itt_nona_dat %>%
  dplyr::count(dafh = ordered(out_dafh, levels = 0:27), .drop = F) %>%
  mutate(p = n / sum(n))
p <- ggplot(pdat, aes(dafh, p)) +
  geom_col() +
  labs(
    x = "Days alive and free of hospital", 
    y = "Proportion"
  )
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "outcome-7-4-dist-overall.pdf"), p, height = 2.5, width = 6)
p

(a) FAS-ITT
Figure 2: Distribution of days alive and free of hospital, FAS-ITT.

Anticoagulation

Summary of DAFH outcome by arm
save_tex_table(
  make_summary_table_anticoagulation(fas_itt_dat, "latex"), 
  file.path("outcomes", "secondary", "7-4-anticoagulation-summary"))
make_summary_table_anticoagulation(fas_itt_dat)
Anticoagulation intervention Patients Known Deaths DAFH, Median (Q1, Q3)
Not randomised to anticoagulation 32 31 0 (0%) 22 (18, 24)
Low-dose 610 597 19 (3%) 23 (21, 24)
Intermediate-dose 613 607 15 (2%) 23 (21, 24)
Low-dose with aspirin 283 280 10 (4%) 22 (20, 24)
Therapeutic-dose 50 50 6 (12%) 22 (19, 24)
Overall 1588 1565 50 (3%) 23 (21, 24)
Table 1: Summary of days alive and free of hospital to day 28 by anticoagulation treatment group, FAS-ITT.
DAFH by intervention
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    CAssignment = factor(CAssignment, labels = str_replace(intervention_labels()$CAssignment, "<br>", "\n")),
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(CAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(CAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Anticoagulation intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of hospital", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.75, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-4-descriptive-anticoagulation.pdf"), p, height = 3, width = 6)
p

Figure 3: Distribution of days alive and free of hospital by anti-coagulation intervention, FAS-ITT.
DAFH by intervention
p <- ggplot(pdat, aes(dafh, cp)) +
  geom_step(aes(colour = CAssignment, group = CAssignment)) +
  labs(x = "Days alive and free of hospital", y = "Cumulative proportion") +
  scale_colour_viridis_d(
    "Days alive and\nfree of hospital", option = "A", begin = 0, end = 0.8) +
  guides(fill = guide_legend(reverse = TRUE))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-4-descriptive-anticoagulation2.pdf"), p, height = 3, width = 6)
p

Figure 4: Cumulative distribution of days alive and free of hospital by anti-coagulation intervention.
DAFH by intervention
pdat <- avs_itt_nona_dat %>%
  dplyr::count(
    CAssignment = factor(CAssignment, labels = str_replace(intervention_labels()$CAssignment, "<br>", "\n")),
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(CAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(CAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Anticoagulation intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of hospital", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.75, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-4-descriptive-anticoagulation-avs-itt.pdf"), p, height = 3, width = 6)
p

Figure 5: Distribution of days alive and free of hospital by anti-coagulation intervention, AVS-ITT.

Antiviral

Summary of DAFH outcome by arm
save_tex_table(
  make_summary_table_antiviral(fas_itt_dat, "latex"), 
  file.path("outcomes", "secondary", "7-4-antiviral-summary"))
make_summary_table_antiviral(fas_itt_dat)
Antiviral intervention Patients Known Deaths DAFH, Median (Q1, Q3)
Not randomised to antiviral 1433 1412 50 (4%) 23 (21, 24)
Standard of care 73 72 0 (0%) 22 (20, 24)
Nafamostat 82 81 0 (0%) 22 (19, 24)
Overall 1588 1565 50 (3%) 23 (21, 24)
Table 2: Summary of days alive and free of hospital to day 28 by antiviral treatment group, FAS-ITT.
DAFH by intervention
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    AAssignment = factor(AAssignment, labels = str_replace(intervention_labels()$AAssignment, "<br>", "\n")),
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(AAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(AAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Antiviral intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of hospital", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.75, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-4-descriptive-antiviral.pdf"), p, height = 3, width = 6)
p

Figure 6: Distribution of days alive and free of hospital by antiviral intervention, FAS-ITT.
DAFH by intervention
p <- ggplot(pdat, aes(dafh, cp)) +
  geom_step(aes(colour = AAssignment, group = AAssignment)) +
  labs(x = "Days alive and free of hospital", y = "Cumulative proportion") +
  scale_colour_viridis_d(
    "Days alive and\nfree of hospital", option = "A", begin = 0, end = 0.8) +
  guides(fill = guide_legend(reverse = TRUE))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-4-descriptive-antiviral2.pdf"), p, height = 3, width = 6)
p

Figure 7: Cumulative distribution of days alive and free of hospital by antiviral intervention.
DAFH by intervention
pdat <- avs_itt_nona_dat %>%
  dplyr::count(
    AAssignment = factor(AAssignment, labels = c("Usual care", "Nafamostat")),
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(AAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(AAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Antiviral intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of hospital", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.6, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
fpth <- file.path(pth, "outcome-7-4-descriptive-antiviral-avs-tt.pdf") 
ggsave(fpth, p + coord_flip(), height = 2.5, width = 6)
system(sprintf("pdftoppm %s %s -png", fpth, gsub(".pdf", "", fpth)))
p

Figure 8: Distribution of days alive and free of hospital by antiviral intervention, AVS-ITT.
DAFH by intervention
pdat <- acs_itt_nona_dat %>%
  dplyr::count(
    AAssignment = factor(AAssignment, labels = str_replace(intervention_labels()$AAssignment, "<br>", "\n")),
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(AAssignment) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p <- ggplot(pdat, aes(AAssignment, p)) +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Antiviral intervention", y = "Cumulative proportion") +
  scale_fill_viridis_d("Days alive and\nfree of hospital", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.75, "lines"))
pth <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(pth, "outcome-7-4-descriptive-antiviral-acs-itt.pdf"), p, height = 3, width = 6)
p

Figure 9: Distribution of days alive and free of hospital by antiviral intervention, ACS-ITT.

Age

DAFH by age
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    agegrp = cut(AgeAtEntry, c(18, seq(25, 75, 5), 100), include.lowest = T, right = F),
    dafh = fct_rev(ordered(out_dafh, levels = 0:27)), 
    .drop = F) %>%
  group_by(agegrp) %>%
  mutate(p = n / sum(n))
pdat2 <- pdat %>%
  group_by(agegrp) %>%
  summarise(n = sum(n))
p1 <- ggplot(pdat2, aes(agegrp, n)) +
  geom_col(colour = "grey40", fill = "grey40") +
  geom_vline(xintercept = 60, linetype = 2) +
  labs(y = "Number of\nparticipants",
       x = "Age at entry") +
  geom_vline(xintercept = 8.5, linetype = 2) +
  theme(axis.text.x = element_text(hjust = 1, angle = 45))
p2 <- ggplot(pdat, aes(agegrp, p)) +
  geom_col(aes(fill = dafh)) +
  labs(x = "Age", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFH", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  geom_vline(xintercept = 8.5, linetype = 2) +
  theme(axis.text.x = element_text(hjust = 1, angle = 45)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-4-age.pdf"), p, height = 2.5, width = 6)
p

Figure 10: Distribution of days alive and free of hospital by age group, FAS-ITT.

Sex

DAFH by sex
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    Sex,
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(Sex) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
pdat2 <- pdat %>%
  group_by(Sex) %>%
  summarise(n = sum(n))
p1 <- ggplot(pdat2, aes(Sex, n)) +
  geom_col() +
    labs(
      y = "Number of\nparticipants")
p2 <- ggplot(pdat, aes(Sex, p)) +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Sex", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFH", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-4-sex.pdf"), p, height = 2.5, width = 6)
p

Figure 11: Distribution of days alive and free of hospital by sex, FAS-ITT.

Oxygen

DAFH by oxygen
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    supp_oxy2 = factor(supp_oxy2, labels = c("Not required", "Required")),
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(supp_oxy2) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
pdat2 <- pdat %>%
  group_by(supp_oxy2) %>%
  summarise(n = sum(n))
p1 <- ggplot(pdat2, aes(supp_oxy2, n)) +
  geom_col() +
    labs(
      y = "Number of\nparticipants", 
      x = "Supplemental oxygen")
p2 <- ggplot(pdat, aes(supp_oxy2, p)) +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Supplemental oxygen", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFH", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-4-oxygen.pdf"), p, height = 2.5, width = 6)
p

Figure 12: Distribution of days alive and free of hospital by oxygen requirement, FAS-ITT.

Country

DAFH by country
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    Country = fct_infreq(Country),
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(Country) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
pdat2 <- pdat %>%
  group_by(Country) %>%
  summarise(n = sum(n))
p1 <- ggplot(pdat2, aes(Country, n)) +
  geom_col() +
    labs(
      y = "Number of\nparticipants", 
      x = "Country of enrolment")
p2 <- ggplot(pdat, aes(Country, p)) +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Country", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFH", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-4-country.pdf"), p, height = 2.5, width = 6)
p

Figure 13: Distribution of days alive and free of hospital by country, FAS-ITT.

Site

DAFH by site
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    Country = factor(PT_CountryName, levels = c("India", "Australia", "Nepal", "New Zealand"),
                     labels = c("India", "Australia", "Nepal", "New\nZealand")),
    Site = fct_infreq(site),
    dafh = ordered(out_dafh, levels = 0:27)) %>%
  complete(dafh = ordered(0:27), nesting(Country, Site), fill = list(n = 0)) %>%
  group_by(Country, Site) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup() %>%
  mutate(
    Country = droplevels(Country),
    Site = droplevels(Site)
  )
pdat2 <- pdat %>%
  group_by(Country, Site) %>%
  summarise(n = sum(n)) %>%
  ungroup()
p1 <- ggplot(pdat2, aes(Site, n)) +
  facet_grid( ~ Country, scales = "free_x", space = "free_x") +
  geom_col() +
    labs(
      y = "Number of\nparticipants", 
      x = "") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1),
        panel.border = element_rect(fill = NA))
p2 <- ggplot(pdat, aes(Site, p)) +
  facet_grid( ~ Country, scales = "free_x", space = "free_x") +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Study Site", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFH", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE, ncol = 1)) +
  theme(axis.text.x = element_text(hjust = 1, angle = 45)) +
  theme(legend.key.size = unit(0.25, "lines"))
p <- p1 / p2 +
  plot_layout(guides = 'collect')
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-4-country-site.pdf"), p, height = 4, width = 6.25)
p

Figure 14: Distribution of days alive and free of hospital by study site, FAS-ITT.

Calendar Time

DAFH by calendar date
pdat <- fas_itt_nona_dat %>%
  dplyr::count(
    yr = year(RandDate), mth = month(RandDate),
    dafh = ordered(out_dafh, levels = 0:27), 
    .drop = F) %>%
  group_by(yr, mth) %>%
  mutate(p = n / sum(n)) %>%
  mutate(cp = cumsum(p)) %>%
  ungroup()
p1 <- pdat %>%
  group_by(yr, mth) %>%
  summarise(n = sum(n)) %>%
  ggplot(., aes(mth, n))  +
  facet_grid( ~ yr, drop = T, scales = "free_x", space = "free") +
    geom_col() +
    labs(
      y = "Number of\nparticipants", 
      x = "Calendar date (month of year)") +
  scale_x_continuous(breaks = 1:12)
p2 <- ggplot(pdat, aes(mth, p)) +
  facet_grid( ~ yr, drop = T, scales = "free_x", space = "free") +
  geom_col(aes(fill = fct_rev(dafh))) +
  labs(x = "Calendar date (month of year)", y = "Cumulative\nproportion") +
  scale_fill_viridis_d("DAFH", option = "A", direction = -1) +
  guides(fill = guide_legend(reverse = TRUE)) +
  theme(legend.key.size = unit(0.25, "lines")) +
  scale_x_continuous(breaks = 1:12)
p <- p1 | p2
path <- file.path("outputs", "figures", "outcomes", "secondary")
ggsave(file.path(path, "7-4-calendar-time.pdf"), p, height = 2, width = 6)
p

Figure 15: Distribution of days alive and free of hospital by calendar time, FAS-ITT.

Sample Cumulative Logits

Some evidence of a shift from proportional odds at higher values of DAFH.

Plot sample cumulative logits
trt_counts <- fas_itt_nona_dat %>%
  dplyr::count(CAssignment, out_dafh) %>%
  complete(CAssignment, out_dafh, fill = list(n = 0)) %>%
  group_by(CAssignment) %>%
  mutate(p = n / sum(n))
trt_logit <- trt_counts %>% 
  group_by(CAssignment) %>% 
  mutate(clogit = logit(cumsum(p))) %>%
  group_by(out_dafh) %>%
  mutate(rel_clogit = clogit - mean(clogit)) %>%
  filter(out_dafh != 27)
ggplot(trt_logit, aes(out_dafh, rel_clogit)) +
  facet_wrap( ~ CAssignment) +
  geom_point() +
  labs(y = "Relative (to mean) sample cumulative logit")

Inspect sample cumulative logits.
Plot sample cumulative logits
trt_counts <- fas_itt_nona_dat %>%
  dplyr::count(AAssignment, out_dafh) %>%
  complete(AAssignment, out_dafh, fill = list(n = 0)) %>%
  group_by(AAssignment) %>%
  mutate(p = n / sum(n))
trt_logit <- trt_counts %>% 
  group_by(AAssignment) %>% 
  mutate(clogit = logit(cumsum(p))) %>%
  group_by(out_dafh) %>%
  mutate(rel_clogit = clogit - mean(clogit)) %>%
  filter(out_dafh != 27)
ggplot(trt_logit, aes(out_dafh, rel_clogit)) +
  facet_wrap( ~ AAssignment) +
  geom_point() +
  labs(y = "Relative (to mean) sample cumulative logit")

Inspect sample cumulative logits.

Modelling

FAS-ITT

The full platform model (excluding baseline CRP) is fit to the FAS-ITT dataset.

Fit primary model
res <- fit_primary_model(
  fas_itt_nona_dat,
  ordmod,
  outcome = "out_dafh",
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]
names(res$drws$OR) <- c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR), "latex"),
  "outcomes/secondary/7-4-primary-model-fas-itt-summary-table")
odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 1.06 (0.59, 1.93) 1.11 (0.35) 0.58
Intermediate-dose 1.17 (0.96, 1.42) 1.17 (0.12) 0.94
Low-dose with aspirin 1.08 (0.81, 1.42) 1.09 (0.15) 0.70
Therapeutic-dose 0.66 (0.36, 1.18) 0.69 (0.21) 0.08
Ineligible aspirin 1.08 (0.57, 2.07) 1.14 (0.38) 0.60
Age ≥ 60 0.61 (0.50, 0.75) 0.62 (0.07) 0.00
Female 1.14 (0.95, 1.37) 1.15 (0.11) 0.92
Oxygen requirement 0.46 (0.37, 0.57) 0.47 (0.05) 0.00
Australia/New Zealand 1.01 (0.46, 2.20) 1.09 (0.46) 0.51
Nepal 0.85 (0.26, 3.06) 1.05 (0.85) 0.39
Posterior summaries for model parameters (fixed-effects), FAS-ITT.
Code
p <- plot_or_densities(c(res$drws$AOR, res$drws$COR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-4-primary-model-fas-itt-odds-ratio-densities.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 16: Posterior densities for odds ratio contrasts.
Odds ratio summary for epoch and site
p <- plot_epoch_site_terms(
  res$drws$gamma_epoch,
  res$drws$gamma_site,
  factor(res$dat$region_by_site, 
         labels = c("India", "Australia\nNew Zealand", "Nepal"))
)
pth <- file.path("outputs", "figures", "outcomes", "secondary", "7-4-primary-model-epoch-site-terms-fas-itt.pdf")
ggsave(pth, p, width = 6, height = 4.5)
p

Summary of epoch and site posterior odds ratios.
Code
res$fit$summary(
  c("alpha", "beta", "gamma_epoch", "gamma_site", "tau_epoch", "tau_site")) %>%
  print(n = Inf)
# A tibble: 81 × 10
   variable           mean   median     sd    mad      q5     q95  rhat ess_bulk
   <chr>             <num>    <num>  <num>  <num>   <num>   <num> <num>    <num>
 1 alpha[1]       -4.10    -4.10e+0 0.389  0.381  -4.73   -3.46    1.01    1653.
 2 alpha[2]       -4.08    -4.08e+0 0.389  0.382  -4.72   -3.44    1.01    1650.
 3 alpha[3]       -4.06    -4.07e+0 0.389  0.380  -4.69   -3.42    1.01    1646.
 4 alpha[4]       -4.05    -4.05e+0 0.389  0.381  -4.68   -3.41    1.01    1641.
 5 alpha[5]       -3.97    -3.97e+0 0.387  0.380  -4.60   -3.33    1.01    1628.
 6 alpha[6]       -3.96    -3.96e+0 0.387  0.381  -4.58   -3.32    1.01    1624.
 7 alpha[7]       -3.88    -3.89e+0 0.386  0.379  -4.51   -3.24    1.01    1606.
 8 alpha[8]       -3.83    -3.83e+0 0.385  0.379  -4.45   -3.19    1.01    1596.
 9 alpha[9]       -3.74    -3.74e+0 0.384  0.374  -4.36   -3.10    1.01    1583.
10 alpha[10]      -3.71    -3.72e+0 0.384  0.376  -4.34   -3.08    1.01    1578.
11 alpha[11]      -3.60    -3.60e+0 0.382  0.374  -4.22   -2.97    1.01    1568.
12 alpha[12]      -3.55    -3.55e+0 0.382  0.373  -4.16   -2.91    1.01    1560.
13 alpha[13]      -3.50    -3.51e+0 0.381  0.372  -4.12   -2.87    1.01    1554.
14 alpha[14]      -3.41    -3.42e+0 0.380  0.373  -4.03   -2.78    1.01    1543.
15 alpha[15]      -3.19    -3.19e+0 0.379  0.371  -3.80   -2.56    1.01    1530.
16 alpha[16]      -3.03    -3.03e+0 0.377  0.367  -3.64   -2.40    1.01    1520.
17 alpha[17]      -2.86    -2.86e+0 0.376  0.367  -3.47   -2.23    1.01    1515.
18 alpha[18]      -2.53    -2.53e+0 0.375  0.366  -3.14   -1.91    1.01    1517.
19 alpha[19]      -2.07    -2.07e+0 0.373  0.366  -2.67   -1.45    1.01    1503.
20 alpha[20]      -1.53    -1.53e+0 0.371  0.365  -2.13   -0.909   1.01    1508.
21 alpha[21]      -0.795   -7.98e-1 0.369  0.361  -1.39   -0.175   1.01    1515.
22 alpha[22]       0.215    2.13e-1 0.369  0.361  -0.379   0.829   1.01    1530.
23 alpha[23]       1.16     1.16e+0 0.370  0.363   0.566   1.78    1.01    1548.
24 alpha[24]       2.76     2.75e+0 0.385  0.381   2.14    3.40    1.01    1645.
25 alpha[25]       5.32     5.30e+0 0.555  0.548   4.44    6.27    1.00    3223.
26 beta[1]        -0.144   -1.44e-1 0.357  0.357  -0.733   0.441   1.00   16172.
27 beta[2]         0.0445   4.30e-2 0.212  0.211  -0.300   0.392   1.00   33191.
28 beta[3]        -0.392   -3.94e-1 0.372  0.371  -0.997   0.222   1.00   22373.
29 beta[4]        -0.357   -3.55e-1 0.234  0.232  -0.741   0.0315  1.00   15255.
30 beta[5]         0.0561   5.54e-2 0.110  0.109  -0.124   0.238   1.00   14112.
31 beta[6]         0.258    2.58e-1 0.135  0.133   0.0381  0.481   1.00   13350.
32 beta[7]         0.0814   8.08e-2 0.326  0.323  -0.451   0.616   1.00   28893.
33 beta[8]        -0.491   -4.90e-1 0.106  0.105  -0.665  -0.317   1.00   27120.
34 beta[9]         0.132    1.31e-1 0.0924 0.0915 -0.0204  0.284   1.00   26781.
35 beta[10]       -0.769   -7.68e-1 0.110  0.110  -0.948  -0.589   1.00   25101.
36 beta[11]        0.0111   1.29e-2 0.399  0.397  -0.647   0.664   1.00    5891.
37 beta[12]       -0.150   -1.63e-1 0.614  0.563  -1.11    0.870   1.00    9740.
38 gamma_epoch[1]  0        0       0      0       0       0      NA         NA 
39 gamma_epoch[2]  0.149    1.35e-1 0.256  0.239  -0.250   0.593   1.00    3982.
40 gamma_epoch[3] -0.0688  -7.28e-2 0.288  0.274  -0.535   0.411   1.00    4175.
41 gamma_epoch[4] -0.193   -1.96e-1 0.289  0.281  -0.663   0.287   1.00    3840.
42 gamma_epoch[5] -0.166   -1.73e-1 0.291  0.281  -0.628   0.321   1.00    3760.
43 gamma_epoch[6] -0.245   -2.54e-1 0.291  0.281  -0.706   0.244   1.00    3833.
44 gamma_epoch[7] -0.426   -4.31e-1 0.296  0.287  -0.905   0.0710  1.00    3918.
45 gamma_epoch[8] -0.613   -6.16e-1 0.301  0.294  -1.10   -0.114   1.00    3670.
46 gamma_epoch[9] -0.792   -7.97e-1 0.306  0.298  -1.29   -0.282   1.00    3655.
47 gamma_epoch[1… -1.21    -1.20e+0 0.310  0.303  -1.73   -0.709   1.00    3922.
48 gamma_epoch[1… -1.18    -1.18e+0 0.309  0.304  -1.69   -0.677   1.00    3759.
49 gamma_epoch[1… -0.857   -8.64e-1 0.358  0.355  -1.43   -0.259   1.00    4273.
50 gamma_epoch[1… -0.725   -7.36e-1 0.395  0.388  -1.35   -0.0539  1.00    5041.
51 gamma_site[1]  -0.654   -6.55e-1 0.303  0.292  -1.15   -0.151   1.00    3644.
52 gamma_site[2]   0.158    1.52e-1 0.284  0.274  -0.293   0.637   1.00    2929.
53 gamma_site[3]  -0.509   -5.05e-1 0.424  0.421  -1.21    0.181   1.00    7507.
54 gamma_site[4]  -0.397   -3.96e-1 0.288  0.275  -0.865   0.0780  1.00    3118.
55 gamma_site[5]   0.0933   8.67e-2 0.263  0.249  -0.321   0.533   1.00    2518.
56 gamma_site[6]  -0.573   -5.77e-1 0.321  0.312  -1.09   -0.0474  1.00    4394.
57 gamma_site[7]   1.65     1.64e+0 0.302  0.295   1.18    2.17    1.00    3125.
58 gamma_site[8]   0.427    4.19e-1 0.333  0.325  -0.106   0.982   1.00    4569.
59 gamma_site[9]   0.659    6.49e-1 0.286  0.277   0.208   1.14    1.00    3138.
60 gamma_site[10] -0.357   -3.56e-1 0.339  0.337  -0.912   0.192   1.00    4843.
61 gamma_site[11]  0.442    4.36e-1 0.313  0.300  -0.0602  0.967   1.00    3976.
62 gamma_site[12]  0.0208   5.37e-3 0.203  0.119  -0.289   0.370   1.00   28613.
63 gamma_site[13]  0.0179   3.20e-3 0.204  0.122  -0.300   0.369   1.00   26057.
64 gamma_site[14]  0.0836   2.45e-2 0.250  0.130  -0.221   0.560   1.00   22555.
65 gamma_site[15]  0.00839  1.03e-3 0.204  0.117  -0.318   0.354   1.00   30074.
66 gamma_site[16] -0.0712  -2.11e-2 0.233  0.127  -0.519   0.232   1.00   24471.
67 gamma_site[17]  0.00568  8.18e-4 0.200  0.119  -0.316   0.337   1.00   28766.
68 gamma_site[18] -0.0229  -4.95e-3 0.216  0.121  -0.397   0.306   1.00   27667.
69 gamma_site[19]  0.0445   1.07e-2 0.234  0.126  -0.282   0.461   1.00   27310.
70 gamma_site[20] -0.117   -4.42e-2 0.251  0.133  -0.627   0.167   1.00   19519.
71 gamma_site[21]  0.0439   1.07e-2 0.224  0.124  -0.273   0.439   1.00   25929.
72 gamma_site[22]  0.0247   5.76e-3 0.225  0.125  -0.318   0.413   1.00   28682.
73 gamma_site[23] -0.0208  -4.74e-3 0.216  0.122  -0.393   0.307   1.00   25700.
74 gamma_site[24]  0.0224   6.48e-3 0.175  0.111  -0.254   0.329   1.00   26668.
75 gamma_site[25] -0.0388  -1.03e-2 0.226  0.123  -0.432   0.287   1.00   25892.
76 gamma_site[26] -0.637   -6.04e-1 0.612  0.554  -1.69    0.297   1.00   10470.
77 gamma_site[27]  0.510    4.99e-1 0.615  0.543  -0.475   1.52    1.00   11411.
78 tau_epoch       0.299    2.83e-1 0.0979 0.0872  0.170   0.480   1.00    8609.
79 tau_site[1]     0.795    7.61e-1 0.210  0.187   0.520   1.19    1.00    6012.
80 tau_site[2]     0.194    1.56e-1 0.159  0.142   0.0143  0.504   1.00   12580.
81 tau_site[3]     1.02     8.73e-1 0.628  0.463   0.346   2.19    1.00   13457.
# ℹ 1 more variable: ess_tail <num>
Code
res$fit$diagnostic_summary()
$num_divergent
[1] 0 0 0 0 0 0 0 0

$num_max_treedepth
[1] 0 0 0 0 0 0 0 0

$ebfmi
[1] 0.9117 0.8707 0.8979 0.8995 0.8363 0.8757 0.8659 0.8375
Code
mcmc_trace(res$drws["beta"])

Code
mcmc_trace(res$drws["alpha"])

Code
mcmc_trace(res$drws["gamma_site"])

Code
mcmc_trace(res$drws["gamma_epoch"])

Posterior Predictive

Code
y_raw <- as.integer(levels(res$dat$y_raw))
y_ppc <- res$drws$y_ppc
y_ppc_raw <- rfun(\(x) y_raw[x])(y_ppc)
ppc_dat <- bind_cols(fas_itt_nona_dat, tibble(y_ppc = y_ppc_raw))
grp_ppc <- function(grp, d = 0:27) {
  ppc_dat %>%
    group_by(grp = {{grp}}) %>%
    summarise(
      y_lteq = map_dbl(d, ~ mean(out_dafh <= .x)),
      ypp_lteq = map(d, ~ rvar_mean(y_ppc <= .x)),
      y_eq = map_dbl(d, ~ mean(out_dafh == .x)),
      ypp_eq = map(d, ~ rvar_mean(y_ppc == .x))
    ) %>%
    unnest(c(ypp_lteq, ypp_eq)) %>%
    mutate(days = d) %>%
    ungroup() %>%
    pivot_longer(
      y_lteq:ypp_eq, 
      names_to = c("response", "event"),
      names_sep = "_",
      values_to = "posterior")
}
plot_grp_ppc <- function(dat, lab = "", xlab = "Probability") {
  ggplot(dat %>% 
           filter(response == "ypp", event == "eq"), 
         aes(y = days)) +
    facet_wrap( ~ grp, nrow = 1, scales = "free_x") +
    stat_slabinterval(aes(xdist = posterior), fatten_point = 1)  +
    geom_point(data = dat %>% filter(response == "y", event == "eq"), 
               aes(y = days, x = mean(posterior)),
               colour = "red",
               shape = 23) +
    scale_x_continuous(
      xlab, breaks = c(0, 0.3, 0.6),
      sec.axis = sec_axis(
        ~ . , name = lab, breaks = NULL, labels = NULL)) +
    scale_y_continuous("Days") +
    theme(strip.text = element_text(size = rel(0.7)),
          axis.title.x = element_text(size = rel(0.7)),
          axis.text.x = element_text(size = rel(0.65)),
          axis.title.y = element_text(size = rel(0.75)),
          axis.title.x.bottom = element_blank())
}
pp_A <- grp_ppc(AAssignment)
pp_C <- grp_ppc(CAssignment)
pp_ctry <- grp_ppc(Country)
pp_epoch <- grp_ppc(epoch)
pp_site <- grp_ppc(site) %>%
  left_join(ppc_dat %>% dplyr::count(site, Country), 
            by = c("grp" = "site"))
p0 <- plot_grp_ppc(pp_A, "Antiviral", "")
p1 <- plot_grp_ppc(pp_C, "Anticoagulation", "")
p2 <- plot_grp_ppc(pp_ctry, "Country", "") 
p3 <- plot_grp_ppc(pp_epoch, "Epoch", "")
p4 <- plot_grp_ppc(
  pp_site %>% filter(Country == "IN"), "Sites India", "")
p5 <- plot_grp_ppc(
  pp_site %>% filter(Country == "AU"), "Sites Australia", "")
p6 <- plot_grp_ppc(
  pp_site %>% filter(Country == "NP"), "Sites Nepal", "")
p7 <- plot_grp_ppc(
  pp_site %>% filter(Country == "NZ"), "Sites New Zealand", "")
g1 <- (p0 | p1 | p2) / p3
g2 <- p4 / p5 / (p6 | p7)
pth1 <- file.path(
  "outputs", "figures", "outcomes", "secondary",
  "7-4-primary-model-fas-itt-ppc1.pdf")
pth2 <- file.path(
  "outputs", "figures", "outcomes", "secondary",
  "7-4-primary-model-fas-itt-ppc2.pdf")
ggsave(pth1, g1, width = 6, height = 5, device = cairo_pdf)
ggsave(pth2, g2, width = 6, height = 6, device = cairo_pdf)
g1

Code
g2

ACS-ITT

Fit primary model - ACS-ITT
res <- fit_primary_model(
  acs_itt_nona_dat,
  ordmod,
  outcome = "out_dafh",
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]
names(res$drws$OR) <- c("Ineligible aspirin", "Age \u2265 60", "Female", "Oxygen requirement", "Australia/New Zealand", "Nepal")
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR), "latex"),
  "outcomes/secondary/7-4-primary-model-acs-itt-summary-table")
odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 1.02 (0.52, 1.98) 1.08 (0.37) 0.52
Intermediate-dose 1.17 (0.96, 1.42) 1.17 (0.12) 0.94
Low-dose with aspirin 1.08 (0.82, 1.42) 1.09 (0.15) 0.70
Therapeutic-dose 0.65 (0.36, 1.20) 0.69 (0.22) 0.08
Ineligible aspirin 1.12 (0.59, 2.10) 1.19 (0.39) 0.64
Age ≥ 60 0.61 (0.49, 0.75) 0.61 (0.07) 0.00
Female 1.15 (0.96, 1.39) 1.16 (0.11) 0.94
Oxygen requirement 0.47 (0.38, 0.58) 0.47 (0.05) 0.00
Australia/New Zealand 1.13 (0.50, 2.65) 1.24 (0.56) 0.62
Nepal 0.82 (0.25, 2.95) 1.01 (0.77) 0.37
Posterior summaries for model parameters (fixed-effects), ACS-ITT.
Code
p <- plot_or_densities(c(res$drws$AOR, res$drws$COR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-4-primary-model-acs-itt-odds-ratio-densities.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 17: Posterior densities for odds ratio contrasts, ACS-ITT.

AVS-ITT

Pre-Specified Model

  • excluding epoch
Fit primary model - AVS-ITT
res <- fit_primary_model(
  avs_itt_nona_dat |> mutate(ctry = droplevels(ctry)),
  ordmod_site,
  outcome = "out_dafh",
  vars = c("agegte60", "sexF", "supp_oxy2", "crp_tertile", "ctry"),
  beta_sd_var = c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 1),
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]
names(res$drws$OR) <- c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)", "Nepal")
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR), "latex"),
  "outcomes/secondary/7-4-primary-model-avs-itt-summary-table-pre-spec")
odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 0.81 (0.44, 1.50) 0.85 (0.27) 0.25
Intermediate-dose 3.31 (1.60, 6.92) 3.55 (1.38) 1.00
Low-dose with aspirin 2.29 (0.65, 8.19) 2.82 (2.04) 0.90
Therapeutic-dose 1.95 (0.72, 5.37) 2.23 (1.23) 0.91
Age ≥ 60 0.18 (0.09, 0.36) 0.19 (0.07) 0.00
Female 0.92 (0.51, 1.67) 0.96 (0.30) 0.39
Required oxygen 0.73 (0.37, 1.42) 0.77 (0.27) 0.18
CRP (2nd tertile) 0.56 (0.26, 1.20) 0.61 (0.24) 0.07
CRP (3rd tertile) 0.75 (0.35, 1.60) 0.81 (0.33) 0.23
CRP (unknown) 1.69 (0.60, 4.74) 1.94 (1.08) 0.84
Nepal 1.21 (0.28, 4.88) 1.56 (1.28) 0.61
Posterior summaries for model parameters (fixed-effects), AVS-ITT.
Code
p <- plot_or_densities(c(res$drws$AOR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-4-primary-model-avs-itt-odds-ratio-densities-pre-spec.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 18: Posterior densities for odds ratio contrasts, AVS-ITT.
Odds ratio summary for epoch and site
p <- plot_site_terms(
  res$drws$gamma_site,
  factor(res$dat$region_by_site, 
         labels = c("Australia\nNew Zealand", "Nepal"))
)
pth <- file.path("outputs", "figures", "outcomes", "secondary", "7-4-primary-model-site-terms-avs-itt-pre-spec.pdf")
ggsave(pth, p, width = 6, height = 4.5)
p

Summary of epoch and site posterior odds ratios.

Reduced Model

  • excluding epoch, site, and country due to small sample size
Fit primary model - AVS-ITT
res <- fit_primary_model(
  avs_itt_nona_dat,
  ordmod0,
  outcome = "out_dafh",
  vars = c("agegte60", "sexF", "supp_oxy2", "crp_tertile"),
  beta_sd_var = c(2.5, 2.5, 2.5, 2.5, 2.5, 2.5),
  intercept = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
names(res$drws$COR) <- intervention_labels2()$CAssignment[-(1:2)]
names(res$drws$OR) <- c("Age \u2265 60", "Female", "Required oxygen", "CRP (2nd tertile)", "CRP (3rd tertile)", "CRP (unknown)")
Odds ratio summary table
save_tex_table(
  odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR), "latex"),
  "outcomes/secondary/7-4-primary-model-avs-itt-summary-table")
odds_ratio_summary_table_rev(c(res$drws$AOR, res$drws$COR, res$drws$OR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 0.81 (0.44, 1.49) 0.85 (0.27) 0.25
Intermediate-dose 3.28 (1.57, 6.85) 3.52 (1.37) 1.00
Low-dose with aspirin 2.35 (0.67, 8.20) 2.89 (2.07) 0.91
Therapeutic-dose 2.00 (0.74, 5.41) 2.27 (1.25) 0.91
Age ≥ 60 0.18 (0.09, 0.38) 0.20 (0.07) 0.00
Female 0.93 (0.51, 1.69) 0.97 (0.30) 0.40
Required oxygen 0.71 (0.36, 1.37) 0.75 (0.26) 0.16
CRP (2nd tertile) 0.56 (0.26, 1.17) 0.60 (0.24) 0.06
CRP (3rd tertile) 0.75 (0.35, 1.58) 0.80 (0.32) 0.22
CRP (unknown) 1.73 (0.66, 4.60) 1.96 (1.05) 0.87
Posterior summaries for model parameters (fixed-effects), AVS-ITT.
Code
p <- plot_or_densities(c(res$drws$AOR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
pth <- file.path("outputs", "figures", "outcomes", "primary", "7-4-primary-model-avs-itt-odds-ratio-densities.pdf")
ggsave(pth, p, width = 6, height = 2.5)
p

Figure 19: Posterior densities for odds ratio contrasts, AVS-ITT.

Treatment-only

Fit primary model - AVS-ITT
res <- fit_primary_model(
  avs_itt_nona_dat,
  ordmod0,
  outcome = "out_dafh",
  vars = NULL,
  beta_sd_var = NULL,
  intercept = FALSE,
  includeC = FALSE
)
names(res$drws$AOR) <- "Nafamostat"
Odds ratio summary table
odds_ratio_summary_table_rev(c(res$drws$AOR))
Parameter Median 95% CrI Mean (SD) Pr(OR > 1)
Nafamostat 1 (0.59, 1.73) 1.04 (0.30) 0.50
Posterior summaries for model parameters (fixed-effects), AVS-ITT.
Code
p <- plot_or_densities(c(res$drws$AOR)) +
  labs(x = "Odds ratio (log scale)", y = "Comparison")
p

Figure 20: Posterior densities for odds ratio contrasts, AVS-ITT.